<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateAppUserAddressTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('user_address', function(Blueprint $table)
		{
			$table->integer('id', true);
			$table->integer('user_id')->comment('用户id');
			$table->string('consignee', 20)->comment('收货人');
			$table->string('phone', 20)->comment('联系方式');
			$table->integer('province')->comment('省');
			$table->integer('city')->nullable()->comment('市');
			$table->integer('district')->nullable()->comment('区/县');
			$table->string('address')->comment('详细地址');
			$table->string('addresses', 500)->comment('完整地址');
			$table->boolean('is_default')->default(1)->comment('默认地址 1不是 2是');
			$table->boolean('status')->default(1)->comment('状态 1正常 2已删除');
			$table->dateTime('create_time')->nullable();
			$table->dateTime('update_time')->nullable();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('app_user_address');
	}

}
